﻿using System;
using System.Diagnostics;

namespace ThePingMaster
{
    public class CommandExecuter : ICommandExecuter
    {
        private readonly ILogger _logger;

        public CommandExecuter(ILogger logger)
        {
            _logger = logger;
        }

        public void Execute(string command, string parameters)
        {
            try
            {
                Process.Start(command, parameters);
            }
            catch (Exception exception)
            {
                _logger.Error(String.Format(@"Error occurred running command {0}", command), exception);
            }            
        }
    }
}
